﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<style type="text/css">
    .ui-jqgrid .table-bordered th {
        height: 52px !important;
    }
</style>
<script type="text/javascript">
    var currRowId = 0;
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        $('select').bindSelect();
    }
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BOM/Product/GetTechnicalChangeJson",
            height: $(window).height() - 136,
            colModel: [
                { label: '更改单编号', name: 'LXD', width: 100, align: 'center', frozen: true, sortable: false },
                { label: '版本', name: 'BB', width: 40, align: 'center', sortable: false },
                { label: '更改<br />级别', name: 'GGJB', width: 36, align: 'center', sortable: false },
                { label: '属性<br />更改', name: 'SXGG', width: 36, align: 'center', sortable: false },
                { label: '结构<br />更改', name: 'JGGG', width: 36, align: 'center', sortable: false },
                { label: '图纸<br />更改', name: 'TZGG', width: 36, align: 'center', sortable: false },
                { label: '旧代号', name: 'O_TH', width: 120, align: 'left', sortable: false },
                { label: '旧版本', name: 'O_BB', width: 50, align: 'center', sortable: false },
                { label: '旧版次', name: 'O_BC', width: 50, align: 'center', sortable: false },
                { label: '旧名称', name: 'O_MC', width: 200, align: 'left', sortable: false },
                { label: '旧类', name: 'O_LEI', width: 60, align: 'left', sortable: false },
                { label: '旧特性', name: 'O_TX', width: 50, align: 'center', sortable: false },
                { label: '旧状态', name: 'O_ZT', width: 50, align: 'center', sortable: false },
                { label: '旧类别', name: 'O_LB', width: 50, align: 'center', sortable: false },
                { label: '旧参图号', name: 'O_CTH', width: 120, align: 'left', sortable: false },
                { label: '旧图幅', name: 'O_TF', width: 60, align: 'center', sortable: false },
                { label: '旧重量', name: 'O_ZL', width: 60, align: 'center', sortable: false },
                { label: '旧材料代码', name: 'O_CLDM', width: 120, align: 'left', sortable: false },
                { label: '旧材料名称', name: 'O_CL', width: 200, align: 'left', sortable: false },
                { label: '旧分级', name: 'O_JF', width: 80, align: 'center', sortable: false },
                { label: '旧创建者', name: 'O_CJZ', width: 80, align: 'center', sortable: false },
                { label: '旧备注', name: 'O_BZ', width: 80, align: 'center', sortable: false },
                { label: '新代号', name: 'N_TH', width: 120, align: 'left', sortable: false },
                { label: '新版本', name: 'N_BB', width: 50, align: 'center', sortable: false },
                { label: '新版次', name: 'N_BC', width: 50, align: 'center', sortable: false },
                { label: '新名称', name: 'N_MC', width: 200, align: 'left', sortable: false },
                { label: '新类', name: 'N_LEI', width: 60, align: 'left', sortable: false },
                { label: '新特性', name: 'N_TX', width: 50, align: 'center', sortable: false },
                { label: '新状态', name: 'N_ZT', width: 50, align: 'center', sortable: false },
                { label: '新类别', name: 'N_LB', width: 50, align: 'center', sortable: false },
                { label: '新参图号', name: 'N_CTH', width: 120, align: 'left', sortable: false },
                { label: '新图幅', name: 'N_TF', width: 60, align: 'center', sortable: false },
                { label: '新重量', name: 'N_ZL', width: 60, align: 'center', sortable: false },
                { label: '新材料代码', name: 'N_CLDM', width: 120, align: 'left', sortable: false },
                { label: '新材料名称', name: 'N_CL', width: 200, align: 'left', sortable: false },
                { label: '新分级', name: 'N_JF', width: 80, align: 'center', sortable: false },
                { label: '新创建者', name: 'N_CJZ', width: 80, align: 'center', sortable: false },
                { label: '新备注', name: 'N_BZ', width: 80, align: 'center', sortable: false },
                { label: '说明', name: 'SM', width: 320, align: 'left', sortable: false },
                { label: '附录', name: 'FL', width: 320, align: 'left', sortable: false },
                { label: '附注', name: 'FZ', width: 320, align: 'left', sortable: false },
                { label: '创建者', name: 'CJZ', width: 80, align: 'center', sortable: false },
                { label: '创建日期', name: 'CJRQ', width: 80, align: 'center', sortable: false },
                { label: '批准日期', name: 'PZRQ', width: 80, align: 'center', sortable: false },
                { label: '导入文件名称', name: 'FileName', width: 120, align: 'left', sortable: false },
                { label: '更改人员', name: 'FUpdateBy', width: 80, align: 'center', sortable: false },
                { label: '更改日期', name: 'FUpdateDate', width: 80, align: 'center', sortable: false },
                { label: '更改时间', name: 'FUpdateTime', width: 80, align: 'center', sortable: false }
            ],
            postData: { keyword: $("#txt_keyword").val(), memo: $("#txt_memo").val(), begin: $("#txt_begin").val(), end: $("#txt_end").val() },
            pager: "#gridPager",
            sortname: 'LXD DESC',
            viewrecords: true,
            rownumWidth: 40,
            gridComplete: function () {

            },
            loadComplete: function () {
                var ids = $gridList.jqGrid("getDataIDs");
                var length = ids.length;
                if (length > 0) {
                    if (currRowId == 0) {
                        currRowId = 1;
                    } else if (currRowId > length) {
                        currRowId = length;
                    }
                }
                var $grid = $('#gview_gridList .ui-jqgrid-bdiv');
                $grid.scrollTop(0);
                //if (currRowId > 0) {
                //    $gridList.jqGrid('setSelection', currRowId);
                //    var $grid = $('#gview_gridList .ui-jqgrid-bdiv');
                //    if (isJump) {
                //        $grid.setScrollTop(length, currRowId);
                //        isJump = false;
                //    } else {
                //        var top = $grid.scrollTop();
                //        $grid.scrollTop(top + 1);
                //    }
                //}
            },
            onSelectRow: function (rowid) {
            },
            onPaging: function (page_btn) {
                currRowId = 0;
            }
        });
        $gridList.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        $gridList.jqGrid('setFrozenColumns');
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { keyword: $("#txt_keyword").val(), number: $("#txt_number").val(), name: $("#txt_name").val(), memo: $("#txt_memo").val(), begin: $("#txt_begin").val(), end: $("#txt_end").val() },
                page: 1,
            }).trigger('reloadGrid');
        });
    }
</script>
<div id="layout" style="height: 100%; width: 100%;">
    <form id="form1">
        <div style="padding: 12px 0 5px 0; padding-left: 15px; border-bottom: 1px solid #ccc; " class="line-table input-width-105">
            <div class="btn-group" style="margin-top:-9px;">
                更改单号<br /><input id="txt_keyword" name="" placeholder="" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                旧/新代号<br /><input id="txt_number" name="txt_number" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                旧/新名称<br /><input id="txt_name" name="txt_name" type="text" class="form-control input-width-140" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                更改说明<br /><input id="txt_memo" name="" type="text" class="form-control input-width-140" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                执行日期起始<br /><input id="txt_begin" name="" type="text" onclick="WdatePicker()" class="form-control input-wdatepicker" value="" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                执行日期结束<br /><input id="txt_end" name="" type="text" onclick="WdatePicker()" class="form-control input-wdatepicker" value="" /> &nbsp;
            </div>
            <div class="btn-group" style="">
                <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 检索</a>
            </div>
            <div class="btn-group" style="float:right;">
                <a id="" class="btn btn-primary center-block" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span> 刷新</a>
                <a id="" class="btn btn-primary center-block disabled" onclick=""><span class="glyphicon glyphicon-download"></span> 导出</a>
            </div>
        </div>
    </form>
    <div style="">
        <table id="gridList"></table>
        <div id="gridPager"></div>
    </div>
</div>

